﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PickerControl.ascx.cs"
	Inherits="PickerControl.PickerControl" %>

<asp:Panel ID="pickerPanel" runat="server">
	<script type="text/javascript" >
		//<![CDATA[
		function <%= SetValueFunctionName %>(valueToSet) {
			document.getElementById('<%= selectedValueTextBox.ClientID %>').value = valueToSet;
		};
		
		function <%= OpenPickerFunctionName %>() {
			var pickerUrl = '<%= ResolveUrl(PickerUrl) %>';
			var pickerArgs = '?callback=<%= SetValueFunctionName %>';
			var pickerFeatures = "location=no,status=yes,resizable=yes,scrollbars=yes,width=600,height=400";
			var pickerForm = window.open(pickerUrl+pickerArgs, '<%= PickerWindowName %>', pickerFeatures);
			pickerForm.opener = self;
			pickerForm.focus();
		}
		//]]>
	</script>

	<table cellpadding="0px" cellspacing="0px" border="0px">
		<tr>
			<td width="100%">
				<asp:TextBox ID="selectedValueTextBox" runat="server" ReadOnly="true"></asp:TextBox>
			</td>
			<td><asp:Button ID="openPickerButton" runat="server" Text="..." /></td>
		</tr>
	</table>
</asp:Panel>
